package com.sinitek.page;

import java.util.List;

/**
 * @program: elastic
 * @description:
 * @author: Mr.chen
 * @create: 2019-04-24 15:39
 */
public class Page<T> extends SimplePage implements Paginable {

    /**
     * 当前页的数据
     */
    private List<T> data;

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Page() {
    }

    public Page(int pageNo, int pageSize, int totalCount) {
        super(pageNo, pageSize, totalCount);
    }

    @SuppressWarnings({"unchecked", "rawtypes"})
    public Page(int pageNo, int pageSize, int totalCount, List data) {
        super(pageNo, pageSize, totalCount);
        this.data = data;
    }

    public int getFirstResult() {
        return (pageNo - 1) * pageSize;
    }


}
